package com.wjjun.test.ui

import android.content.Intent
import android.os.Looper
import android.util.Log
import android.view.View
import androidx.databinding.ViewDataBinding
import androidx.lifecycle.MutableLiveData
import com.bumptech.glide.Glide
import com.wjjun.base.ui.activity.BaseBindingActivity
import com.wjjun.app.R
import com.wjjun.test.ui.viewmodel.TestBaseViewModel

/**
 * 测试基础框架
 * author : wangjunjun
 * date   : 2022/6/28
 * desc   :
 */
class TestBaseActivity : BaseBindingActivity<TestBaseViewModel, ViewDataBinding>() {

    val checked: MutableLiveData<Boolean> = MutableLiveData()

    //布局文件放在viewModel或者这里都可以，优先这里的，如果这里返回0才会使用viewmodel中的, 用于覆盖ViewModel的界面, 可以实现同一个ViewModel不同的布局.
    //如果是lazy的界面，那就只能在viewmodel中获取布局
    override fun getLayoutId(): Int {
        return R.layout.activity_test_base
    }
    override fun initParams() {
    }

    override fun initContent() {
        setTitle("测试基础框架")
    }

    override fun onClick(view: View) {
        when (view.id) {
            R.id.tv_java -> {
                startActivity(Intent(this, TestJavaActivity::class.java))
            }
            R.id.tv_view -> {
                startActivity(Intent(this, TestViewActivity::class.java))
            }
            R.id.tv_lazy -> {
                startActivity(Intent(this, TestStatusActivity::class.java))
            }
            R.id.tv_fragment->{
                startActivity(Intent(this, TestFragmentActivity::class.java))
            }
            R.id.tv_list -> {
                startActivity(Intent(this, TestListActivity::class.java))
            }
            R.id.tv_drag_list ->{
                startActivity(Intent(this, TestDragListActivity::class.java))
            }
            R.id.tv_grid -> {
                startActivity(Intent(this, TestGridActivity::class.java))
            }
            R.id.tv_nest -> {
                startActivity(Intent(this, TestNestListActivity::class.java))
            }
            R.id.tv_window -> {
                startActivity(Intent(this, TestWindowActivity::class.java))
            }
            R.id.tv_req -> {
                startActivity(Intent(this, TestReqActivity::class.java))
            }
        }
    }
}